//
// common.h
//
// CSE 420
// Project 4 : Part 3b
// Authors: Colin Hofman, Alan Tu, Adam Fairfield
//

#ifndef _COMMON_H_
#define _COMMON_H_

// System includes
#include <stdint.h>
#include <math.h>

// Global defines
#define TIMING																						// Turn on timing
#define N										1000                          // Matrix order (rows and columns)
#define BLOCK_SIZE					50														// Block size; N % BLOCK_SIZE must = 0
#define MATRIX_SIZE					N * N													// Pre-calculated to save a few multiplications
#define BLOCK_SIZE_SQUARED	(BLOCK_SIZE * BLOCK_SIZE)			// Pre-calculated to save a few multiplications
#define NUM_THREADS					8
#define ITERATIONS					50

// Control block for DMA
typedef struct _CONTROL_BLOCK
{
	int *blockA;         // Matrix block a
	int *blockB;         // Matrix block b
	int *SPU_result;     // Result block c
	int *padding[1];     // Data padding
} CONTROL_BLOCK;

// Alignment macros
#define QWORD_ALIGNED __attribute__((aligned(16)))
#define CACHE_ALIGNED __attribute__((aligned(128)))

#endif